<?php
//created on mon june 28th 2010 by m.watabe
//just a test


$Array = simplexml_load_string(file_get_contents('style/config.xml'));
$projData = xml2phpArray($Array,array());
$count = 0;

//echo sizeof($projData);

//echo $projData["interfaceHeight"];
//echo $projData["controlPanelWidth"];
//$("canvasProjDiv").setStyle("top", projRect[1]);
/*
foreach ( $projData["project"] as $item)
{
//	echo ($item["id"]);
	echo('<div id = "proj'.$count.'" class="proj"> 					
					<div id = "proj'.$count.'Img" class="projImg"><img src="data/'.$item["id"].'/img.png"></div>
					<div class="captionDiv">'.$item["title"].'</div></div>');

//	foreach($item as $part )
	//echo("yay! ".$part."<br>") ;
}
*/

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<link rel="shortcut icon" href="assets/smarchicon.png" >
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

		<META name="description" content = "SMArchS @ MIT Visualization">
		<META name = "keywords" content = "SMarchS, MIT, architecture">

		<title>Navatomic</title>
		
		
		
		
		
		
		
		
		<STYLE type="text/css">
		body 
		{font-family:helvetica,arial,sans-serif;font-size:12px;margin:0;padding:0;text-align:center;}
		
   		#wrapper {width:'.$projData["interfaceWidth"].';height:'.$projData["interfaceHeight"].';border-width:1;border:solid;text-align:center;}
 		</STYLE>
		
		<link rel="stylesheet" href="style/style.css" type ="text/css"/>
		
		
		
	
	</head>
	<body>
 
	<h1>Navatomic<span class="different"> - a collaborative graph environment</span></h1>
	<div id="wrapper">
		<div id = "controlPanelDiv">
			
		</div>
	
	</div>
	<div>
	
	</div>
	</body>
</html>';

function xml2phpArray($xml,$arr)
{
    $iter = 0;
        foreach($xml->children() as $b){
                $a = $b->getName();
                if(!$b->children()){
                        $arr[$a] = trim($b[0]);
                }
                else{
                        $arr[$a][$iter] = array();
                        $arr[$a][$iter] = xml2phpArray($b,$arr[$a][$iter]);
                }
        $iter++;
        }
        return $arr;
}





?>